﻿using System.Xml.Serialization;

namespace MatchResults.Models
{
    public class Table
    {
        public int ID { get; set; }
        public int ORDERID { get; set; }
        public int MAXORDERID { get; set; }
        public int TYPEINFOFORSEASONID { get; set; }
        public int MATCHSTATUSID { get; set; }
        public int MATCHTYPEID { get; set; }
        public int SEASONID { get; set; }
        public int TEAMID { get; set; }
        public string TEAMNAME_TR { get; set; }
        public string TEAMNAME_EN { get; set; }
        public string TEAMNAMESHORT_TR { get; set; }
        public string TEAMNAMESHORT_EN { get; set; }
        public string MATCHPLAYED { get; set; }
        public string WON { get; set; }
        public string DRAWN { get; set; }
        public string LOST { get; set; }
        public string GOALSFOR { get; set; }
        public string GOALSAGAINST { get; set; }
        public string TOTALSCORE { get; set; }
        public string AVERAGE { get; set; }
        public string FILEURL { get; set; }
        public int WIDTH { get; set; }
        public int HEIGHT { get; set; }


        public string SORTING { get; set; }
        public string MATCHTYPENAME_TR { get; set; }
        public string MATCHTYPENAME_EN { get; set; }
        public string MATCHTYPENAMESHORT_TR { get; set; }
        public string MATCHTYPENAMESHORT_EN { get; set; }
        public string MATCHTYPEFILEURL { get; set; }
        public string MATCHTYPEINFOFORSEASONID { get; set; }
        public string MATCHTYPEINFOFORSEASONID1 { get; set; }
        public string MATCHTYPEINFOFORSEASONNAME_TR { get; set; }
        public string MATCHTYPEINFOFORSEASONNAME_EN { get; set; }
        public string MATCHTYPEINFOFORTOURID { get; set; }
        public string TOURID { get; set; }
        public string TEAM1ID { get; set; }
        public string TEAM1NAME_TR { get; set; }
        public string TEAM1NAME_EN { get; set; }
        public string TEAM1NAMESHORT_TR { get; set; }
        public string TEAM1NAMESHORT_EN { get; set; }
        public string TEAM2ID { get; set; }
        public string TEAM2NAME_TR { get; set; }
        public string TEAM2NAME_EN { get; set; }
        public string TEAM2NAMESHORT_TR { get; set; }
        public string TEAM2NAMESHORT_EN { get; set; }
        public string MATCHSTATUSNAME_TR { get; set; }
        public string MATCHSTATUSNAME_EN { get; set; }
        public string MATCHSTATUS2ID { get; set; }
        public string PLAYINGSTATUS { get; set; }
        public string MATCHSTATUS2NAME_TR { get; set; }
        public string MATCHSTATUS2NAME_EN { get; set; }
        public string SCORE1 { get; set; }
        public string SCORE2 { get; set; }
        public string MATCHTIME { get; set; }
        public string GROUPCONTROL { get; set; }
        public string SEASONNAME_TR { get; set; }
        public string SEASONNAME_EN { get; set; }
        public string TOURNAME_TR { get; set; }
        public string TOURNAME_EN { get; set; }
        public string TOURNAMESHORT_TR { get; set; }
        public string TOURNAMESHORT_EN { get; set; }
        public string STADIUMID { get; set; }
        public string STADIUMNAME_TR { get; set; }
        public string STADIUMNAME_EN { get; set; }
        public string COUNTRYID { get; set; }
        public string CITYID { get; set; }
        public string COACH1ID { get; set; }
        public string COACH2ID { get; set; }
        public string REFEREE1ID { get; set; }
        public string REFEREE2ID { get; set; }
        public string REFEREE3ID { get; set; }
        public string REFEREE4ID { get; set; }
        public string WEATHERID { get; set; }
        public string WEATHERDEGREE { get; set; }
        public string FMSCORE1 { get; set; }
        public string FMSCORE2 { get; set; }


        public string PLAYERID { get; set; }
        public string NAME_TR { get; set; }
        public string NAME_EN { get; set; }
        public string GOALCOUNT { get; set; }
        public string COUNTRYNAME_TR { get; set; }
        public string COUNTRYNAME_EN { get; set; }
        public string COUNTRYFILEURL { get; set; }
        public string BIRTHDATE { get; set; }
        public string DEATHSTATUS { get; set; }
        public string PLAYERPOSITIONTYPEVALUE { get; set; }

        [XmlIgnore]
        public string CalculatedScore
        {
            get
            {
                if (string.IsNullOrEmpty(MATCHSTATUS2ID)||string.IsNullOrEmpty(SCORE1)||string.IsNullOrEmpty(SCORE2)||string.IsNullOrEmpty(MATCHSTATUS2NAME_TR))
                {
                    return string.Empty;
                }
                string strText = "";
                if (MATCHSTATUS2ID == "1")
                {
                    strText = "";
                }
                else if (MATCHSTATUS2ID.ToString() == "8")
                {
                    strText = SCORE1.ToString() + " - " + SCORE2.ToString();
                }
                else
                {
                    if (SCORE1.ToString() != "")
                    {
                        strText = MATCHSTATUS2NAME_TR.ToString() + " : " + SCORE1.ToString() + " - " + SCORE2.ToString();
                    }
                    else
                    {
                        strText = MATCHSTATUS2NAME_TR.ToString();
                    }
                }
                return strText;
            }
        }

    

        [XmlIgnore]
        public int RowNo{get; set;}

    }
}
